|
@@ -85,8 +85,9 @@ class PurchaseOrderClass extends BaseClass
|
|
|
public static function printTicket($orderInfo)
|
|
public static function printTicket($orderInfo)
|
|
|
{
|
|
{
|
|
|
$ghsId = $orderInfo->ghsId ?? 0;
|
|
$ghsId = $orderInfo->ghsId ?? 0;
|
|
|
- $ghsInfo = GhsClass::getById($ghsId, true);
|
|
|
|
|
- $debtAmount = $ghsInfo->debtAmount ? floatval($ghsInfo->debtAmount) : 0;
|
|
|
|
|
|
|
+ $debtCount = PurchaseOrderClass::getCount(['ghsId' => $ghsId, 'debt' => PurchaseOrderClass::DEBT_YES]);
|
|
|
|
|
+ $debtAmount = PurchaseOrderClass::sum(['ghsId' => $ghsId, 'debt' => PurchaseOrderClass::DEBT_YES], 'actPrice');
|
|
|
|
|
+
|
|
|
|
|
|
|
|
$orderSn = $orderInfo->orderSn ?? '';
|
|
$orderSn = $orderInfo->orderSn ?? '';
|
|
|
$itemList = PurchaseOrderItemClass::getAllByCondition(['orderSn' => $orderSn], null, '*');
|
|
$itemList = PurchaseOrderItemClass::getAllByCondition(['orderSn' => $orderSn], null, '*');
|
|
@@ -102,7 +103,6 @@ class PurchaseOrderClass extends BaseClass
|
|
|
$content .= '<BR>';
|
|
$content .= '<BR>';
|
|
|
$content .= '花材 数量/单价 金额 <BR>';
|
|
$content .= '花材 数量/单价 金额 <BR>';
|
|
|
$content .= '--------------------------------<BR>';
|
|
$content .= '--------------------------------<BR>';
|
|
|
- $content .= '--------------------------------<BR>';
|
|
|
|
|
if (isset($itemList) && !empty($itemList)) {
|
|
if (isset($itemList) && !empty($itemList)) {
|
|
|
foreach ($itemList as $current) {
|
|
foreach ($itemList as $current) {
|
|
|
$content = self::printGroup($current, $content);
|
|
$content = self::printGroup($current, $content);
|
|
@@ -144,7 +144,7 @@ class PurchaseOrderClass extends BaseClass
|
|
|
$content .= '实付金额:' . floatval($orderInfo['realPrice']) . '<BR>';
|
|
$content .= '实付金额:' . floatval($orderInfo['realPrice']) . '<BR>';
|
|
|
}
|
|
}
|
|
|
if ($debtAmount > 0) {
|
|
if ($debtAmount > 0) {
|
|
|
- $content .= '累计欠款:' . floatval($debtAmount) . '<BR>';
|
|
|
|
|
|
|
+ $content .= '累计赊账:' . $debtCount . '笔 ' . floatval($debtAmount) . '<BR>';
|
|
|
}
|
|
}
|
|
|
$content .= '--------------------------------<BR>';
|
|
$content .= '--------------------------------<BR>';
|
|
|
|
|
|