当前位置: 首页>>代码示例>>PHP>>正文


PHP Receipt::setReceivedFrom方法代码示例

本文整理汇总了PHP中Receipt::setReceivedFrom方法的典型用法代码示例。如果您正苦于以下问题:PHP Receipt::setReceivedFrom方法的具体用法?PHP Receipt::setReceivedFrom怎么用?PHP Receipt::setReceivedFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Receipt的用法示例。


在下文中一共展示了Receipt::setReceivedFrom方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Main

 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "confirm":
             $PaymentEncode = new SoapObject(NCCBIZ . "PaymentEncode.php", "urn:Object");
             $ReceiptEncode = new SoapObject(NCCBIZ . "ReceiptEncode.php", "urn:Object");
             $CollectionEncode = new SoapObject(NCCBIZ . "CollectionEncode.php", "urn:Object");
             $basicReceiptIDArrayIndex = 0;
             $sefReceiptIDArrayIndex = 0;
             $idleReceiptIDArrayIndex = 0;
             // create Basic Receipts
             foreach ($this->formArray["basicReceipt"] as $basicReceiptArray) {
                 $basicReceipt = new Receipt();
                 $basicReceipt->setReceiptNumber($basicReceiptArray["receiptNumber"]);
                 $basicReceipt->setReceiptDate($this->formArray["paymentDate"]);
                 $basicReceipt->setPaymentMode($this->formArray["paymentMode"]);
                 $basicReceipt->setCheckNumber($this->formArray["checkNumber"]);
                 $basicReceipt->setDateOfCheck($this->formArray["dateOfCheck"]);
                 $basicReceipt->setDraweeBank($this->formArray["draweeBank"]);
                 $basicReceipt->setReceivedFrom($this->formArray["receivedFrom"]);
                 $basicReceipt->setPreviousReceiptNumber($basicReceiptArray["previousReceiptNumber"]);
                 $basicReceipt->setPreviousReceiptDate($basicReceiptArray["previousReceiptDate_year"] . "-" . putPreZero($basicReceiptArray["previousReceiptDate_month"] . "-" . putPreZero($basicReceiptArray["previousReceiptDate_day"])));
                 $basicReceipt->setCityTreasurer($this->formArray["cityTreasurer"]);
                 $basicReceipt->setDeputyTreasurer($this->formArray["deputyTreasurer"]);
                 $basicReceipt->setStatus("");
                 $basicReceipt->setDomDocument();
                 $domDoc = $basicReceipt->getDomDocument();
                 $xmlStr = $domDoc->dump_mem(true);
                 if (!($basicReceiptIDArray[$basicReceiptIDArrayIndex] = $ReceiptEncode->saveReceipt($xmlStr))) {
                     exit("error save basic receipt");
                 }
                 $receiptIDArray[] = $basicReceiptIDArray[$basicReceiptIDArrayIndex];
                 $basicReceiptIDArrayIndex++;
             }
             // create Sef Receipts
             foreach ($this->formArray["sefReceipt"] as $sefReceiptArray) {
                 $sefReceipt = new Receipt();
                 $sefReceipt->setReceiptNumber($sefReceiptArray["receiptNumber"]);
                 $sefReceipt->setReceiptDate($this->formArray["paymentDate"]);
                 $sefReceipt->setPaymentMode($this->formArray["paymentMode"]);
                 $sefReceipt->setCheckNumber($this->formArray["checkNumber"]);
                 $sefReceipt->setDateOfCheck($this->formArray["dateOfCheck"]);
                 $sefReceipt->setDraweeBank($this->formArray["draweeBank"]);
                 $sefReceipt->setReceivedFrom($this->formArray["receivedFrom"]);
                 $sefReceipt->setPreviousReceiptNumber($sefReceiptArray["previousReceiptNumber"]);
                 $sefReceipt->setPreviousReceiptDate($sefReceiptArray["previousReceiptDate_year"] . "-" . putPreZero($sefReceiptArray["previousReceiptDate_month"] . "-" . putPreZero($sefReceiptArray["previousReceiptDate_day"])));
                 $sefReceipt->setCityTreasurer($this->formArray["cityTreasurer"]);
                 $sefReceipt->setDeputyTreasurer($this->formArray["deputyTreasurer"]);
                 $sefReceipt->setStatus("");
                 $sefReceipt->setDomDocument();
                 $domDoc = $sefReceipt->getDomDocument();
                 $xmlStr = $domDoc->dump_mem(true);
                 if (!($sefReceiptIDArray[$sefReceiptIDArrayIndex] = $ReceiptEncode->saveReceipt($xmlStr))) {
                     exit("error save sef receipt");
                 }
                 $receiptIDArray[] = $sefReceiptIDArray[$sefReceiptIDArrayIndex];
                 $sefReceiptIDArrayIndex++;
             }
             // create Idle Receipts
             foreach ($this->formArray["idleReceipt"] as $idleReceiptArray) {
                 $idleReceipt = new Receipt();
                 $idleReceipt->setReceiptNumber($idleReceiptArray["receiptNumber"]);
                 $idleReceipt->setReceiptDate($this->formArray["paymentDate"]);
                 $idleReceipt->setPaymentMode($this->formArray["paymentMode"]);
                 $idleReceipt->setCheckNumber($this->formArray["checkNumber"]);
                 $idleReceipt->setDateOfCheck($this->formArray["dateOfCheck"]);
                 $idleReceipt->setDraweeBank($this->formArray["draweeBank"]);
                 $idleReceipt->setReceivedFrom($this->formArray["receivedFrom"]);
                 $idleReceipt->setPreviousReceiptNumber($idleReceiptArray["previousReceiptNumber"]);
                 $idleReceipt->setPreviousReceiptDate($idleReceiptArray["previousReceiptDate_year"] . "-" . putPreZero($idleReceiptArray["previousReceiptDate_month"] . "-" . putPreZero($idleReceiptArray["previousReceiptDate_day"])));
                 $idleReceipt->setCityTreasurer($this->formArray["cityTreasurer"]);
                 $idleReceipt->setDeputyTreasurer($this->formArray["deputyTreasurer"]);
                 $idleReceipt->setStatus("");
                 $idleReceipt->setDomDocument();
                 $domDoc = $idleReceipt->getDomDocument();
                 $xmlStr = $domDoc->dump_mem(true);
                 if (!($idleReceiptIDArray[$idleReceiptIDArrayIndex] = $ReceiptEncode->saveReceipt($xmlStr))) {
                     exit("error save idle receipt");
                 }
                 $receiptIDArray[] = $idleReceiptIDArray[$idleReceiptIDArrayIndex];
                 $idleReceiptIDArrayIndex++;
             }
             $lineCtr = 0;
             $basicReceiptIDArrayIndex = 0;
             $sefReceiptIDArrayIndex = 0;
             $idleReceiptIDArrayIndex = 0;
             if (is_array($this->formArray["payment"])) {
                 foreach ($this->formArray["payment"] as $formPaymentArray) {
                     $payment = new Payment();
                     $payment->setTdID($formPaymentArray["tdID"]);
                     $payment->setDueID($formPaymentArray["dueID"]);
                     $payment->setDueType($formPaymentArray["dueType"]);
                     $payment->setBacktaxTDID($formPaymentArray["backtaxTDID"]);
                     $payment->setTaxDue($formPaymentArray["taxDue"]);
                     $payment->setAdvancedPaymentDiscount($formPaymentArray["advancedPaymentDiscount"]);
                     $payment->setEarlyPaymentDiscount($formPaymentArray["earlyPaymentDiscount"]);
                     $payment->setPenalty($formPaymentArray["penalty"]);
                     $payment->setAmnesty($formPaymentArray["amnesty"]);
                     $payment->setBalanceDue($formPaymentArray["balanceDue"]);
                     $payment->setAmountPaid($formPaymentArray["amountPaid"]);
//.........这里部分代码省略.........
开发者ID:armic,项目名称:erpts,代码行数:101,代码来源:PaymentEncode.php

示例2: initReceipt

 function initReceipt($payment, $taxType)
 {
     $receipt = new Receipt();
     $receipt->setReceiptDate(date("Y-m-d", strtotime("now")));
     $receipt->setReceivedFrom($payment->getOwnerID());
     $receipt->setTaxType($taxType);
     if ($payment->getDueID() != "") {
         $due = $this->captureDueDetails($payment->getDueID());
     } else {
         if ($payment->getBacktaxTDID() != "") {
             $due = $this->captureBacktaxTDDetails($payment->getBacktaxTDID(), $payment->getDueType());
         } else {
             // should not get here.
             // cannot establish taxDue and thus a proper receipt.
             // exit("error. payment has no dueID / backtaxTDID associated. cannot establish receipts");
         }
     }
     switch ($taxType) {
         case "basic":
             $receipt->setTaxDue(un_number_format($due->getBasicTax()));
             break;
         case "sef":
             $receipt->setTaxDue(un_number_format($due->getSefTax()));
             break;
         case "idle":
             $receipt->setTaxDue(un_number_format($due->getIdleTax()));
             break;
     }
     // use: basicAdvancedPaymentDiscount = (advancedPaymentDiscount/taxDue)(basicTax)
     $advancedPaymentDiscount = un_number_format($payment->getAdvancedPaymentDiscount()) / un_number_format($payment->getTaxDue());
     $advancedPaymentDiscount = $advancedPaymentDiscount * un_number_format($receipt->getTaxDue());
     $receipt->setAdvancedPaymentDiscount($advancedPaymentDiscount);
     // use: basicEarlyPaymentDiscount = (earlyPaymentDiscount/taxDue)(basicTax)
     $earlyPaymentDiscount = un_number_format($payment->getEarlyPaymentDiscount()) / un_number_format($payment->getTaxDue());
     $earlyPaymentDiscount = $earlyPaymentDiscount * un_number_format($receipt->getTaxDue());
     $receipt->setEarlyPaymentDiscount($earlyPaymentDiscount);
     // if amountPaidForQuartersForTaxType > 0 use
     // use: basicPenalty = (penalty/balanceDue)(basicTax)
     // else
     // use: basicPenalty = (penalty/taxDue)(basicTax)
     if ($amountPaidForQuartersForTaxType > 0) {
         $penalty = un_number_format($payment->getPenalty()) / un_number_format($payment->getBalanceDue());
         $penalty = $penalty * un_number_format($receipt->getTaxDue());
     } else {
         $penalty = un_number_format($payment->getPenalty()) / un_number_format($payment->getTaxDue());
         $penalty = $penalty * un_number_format($receipt->getTaxDue());
     }
     $receipt->setPenalty($penalty);
     $receipt->setAmnesty($payment->getAmnesty());
     // use:
     // basicBalanceDue = basicTax
     // ** if discount > 0 : basicBalanceDue = basicTax - [basicEarlyPaymentDiscount or basicAdvancedPaymentDiscount]
     // ** if amnesty is true : basicBalanceDue += basicPenalty
     // basicBalance Due = basicBalanceDue - paidBasic
     $balanceDue = $receipt->getTaxDue();
     if ($receipt->getAdvancedPaymentDiscount() > 0) {
         $balanceDue = $receipt->getTaxDue() - $receipt->getAdvancedPaymentDiscount();
     } else {
         if ($receipt->getEarlyPaymentDiscount() > 0) {
             $balanceDue = $receipt->getTaxDue() - $receipt->getEarlyPaymentDiscount();
         }
     }
     if ($receipt->getAmnesty() != "true") {
         $balanceDue = $balanceDue + un_number_format($receipt->getPenalty());
     }
     $paidTotals = $this->getPaidTotals($payment->getDueID(), $payment->getBacktaxTDID(), $payment->getDueType(), $taxType);
     // if Due Type is "Annual" and previous "Quarter" payments have been made, adjust the Tax Due:
     // this is for reverted annual payments from quarterly mode
     if (is_a($due, "Due")) {
         if ($due->getDueType() == "Annual") {
             $amountPaidForQuartersForTaxType = $this->getAmountPaidForQuarters($due, $taxType);
         }
         if ($amountPaidForQuartersForTaxType > 0) {
             $paidTotals = $amountPaidForQuartersForTaxType;
         }
     }
     $balanceDue = $balanceDue - $paidTotals;
     $receipt->setBalanceDue($balanceDue);
     // use: basicAmountPaid = (basicBalanceDue/balanceDue)(amountPaid)
     $amountPaid = un_number_format($receipt->getBalanceDue()) / un_number_format($payment->getBalanceDue());
     $amountPaid = $amountPaid * un_number_format($payment->getAmountPaid());
     $receipt->setAmountPaid($amountPaid);
     return $receipt;
 }
开发者ID:armic,项目名称:erpts,代码行数:84,代码来源:PaymentReceiptDetails.php


注:本文中的Receipt::setReceivedFrom方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。