Ejemplo n.º 1
0
 public function saveQuotationDetailsAndTax($data)
 {
     try {
         $loggedInUserId = AppUtil::getLoggerInUserId();
         if ($loggedInUserId != null) {
             if ($data != null) {
                 if (Quotation::isRefNoPresent($data->Quotation->RefNo)) {
                     echo AppUtil::getReturnStatus("Unsuccessful", "Quotation reference number is already present");
                     return;
                 }
                 if (Quotation::isQuotationTitlePresent($data->Quotation->ProjectId, $data->Quotation->QuotationTitle)) {
                     echo AppUtil::getReturnStatus("Unsuccessful", "Quotation Title already used for another quotaion");
                     return;
                 }
                 $Quotation = Quotation::saveQuotationDetailsAndTax($data);
                 if ($Quotation) {
                     echo AppUtil::getReturnStatus("Successful", "Quotation created successfully");
                 } else {
                     echo AppUtil::getReturnStatus("Unsuccessful", "Database Error Occurred");
                 }
             } else {
                 echo AppUtil::getReturnStatus("Unsuccessful", "Data value is empty");
             }
         }
     } catch (Exception $e) {
         echo AppUtil::getReturnStatus("Unsuccessful", $e->getMessage());
     }
 }