|
|
@@ -157,47 +157,63 @@ $this->addButton(['label' => 'Nouveau producteur <span class="glyphicon glyphico |
|
|
|
} |
|
|
|
],*/ |
|
|
|
[ |
|
|
|
'attribute' => 'À facturer / chiffre d\'affaire', |
|
|
|
'label' => 'À facturer / chiffre d\'affaire', |
|
|
|
'label' => 'Facturation', |
|
|
|
'format' => 'raw', |
|
|
|
'value' => function($producer) use ($producerManager) { |
|
|
|
|
|
|
|
$str = ''; |
|
|
|
if($producerManager->isBillingFrequencyMonthly($producer)) { |
|
|
|
$str .= $producerManager->getSummaryAmountsToBeBilled($producer, 'Mois dernier', 1); |
|
|
|
} |
|
|
|
elseif($producerManager->isBillingFrequencyQuarterly($producer)) { |
|
|
|
$str .= $producerManager->getSummaryAmountsToBeBilled($producer, '3 derniers mois', 3); |
|
|
|
} |
|
|
|
elseif($producerManager->isBillingFrequencyBiannual($producer)) { |
|
|
|
$str .= $producerManager->getSummaryAmountsToBeBilled($producer, '6 derniers mois', 6); |
|
|
|
} |
|
|
|
$str .= '<ul style="margin: 0px;padding-left: 15px;">'; |
|
|
|
|
|
|
|
$isBillingFrequencyMonthly = $producerManager->isBillingFrequencyMonthly($producer); |
|
|
|
$summaryMonthly = $producerManager->getSummaryAmountsToBeBilled($producer, 'Mois dernier', 1); |
|
|
|
$isBillingFrequencyQuaterly = $producerManager->isBillingFrequencyQuarterly($producer); |
|
|
|
$summaryQuaterly = $producerManager->getSummaryAmountsToBeBilled($producer, '3 derniers mois', 3); |
|
|
|
$isBillingFrequencyBiannual = $producerManager->isBillingFrequencyBiannual($producer); |
|
|
|
$summaryBiannual = $producerManager->getSummaryAmountsToBeBilled($producer, '6 derniers mois', 6); |
|
|
|
|
|
|
|
if(($isBillingFrequencyMonthly && $summaryMonthly) |
|
|
|
|| ($isBillingFrequencyQuaterly && $summaryQuaterly) |
|
|
|
|| ($isBillingFrequencyBiannual && $summaryBiannual)) { |
|
|
|
|
|
|
|
if($producer->option_billing_reduction && strlen($str)) { |
|
|
|
$str .= '<br /><u>Avec réduction</u> : '; |
|
|
|
if($producer->option_billing_reduction_percentage) { |
|
|
|
$str .= ' '.$producer->option_billing_reduction_percentage.' %'; |
|
|
|
$str .= '<li>'; |
|
|
|
if ($isBillingFrequencyMonthly && $summaryMonthly) { |
|
|
|
$str .= $summaryMonthly; |
|
|
|
} elseif ($isBillingFrequencyQuaterly && $summaryQuaterly) { |
|
|
|
$str .= $summaryQuaterly; |
|
|
|
} elseif ($isBillingFrequencyBiannual && $summaryBiannual) { |
|
|
|
$str .= $summaryBiannual; |
|
|
|
} |
|
|
|
|
|
|
|
if ($producer->option_billing_reduction && strlen($str)) { |
|
|
|
$str .= '<br /><u>Avec réduction</u> : '; |
|
|
|
if ($producer->option_billing_reduction_percentage) { |
|
|
|
$str .= ' ' . $producer->option_billing_reduction_percentage . ' %'; |
|
|
|
} |
|
|
|
} |
|
|
|
$str .= '</li>'; |
|
|
|
|
|
|
|
$str .= '<li>Facturation '.strtolower(Producer::$billingFrequencyArray[$producer->option_billing_frequency]).'</li>'; |
|
|
|
} |
|
|
|
|
|
|
|
if($producer->option_billing_permanent_transfer) { |
|
|
|
$str .= '<li>Virement permanent : <strong>'.Price::format($producer->option_billing_permanent_transfer_amount).'</strong></li>'; |
|
|
|
} |
|
|
|
|
|
|
|
$str .= '</ul>'; |
|
|
|
|
|
|
|
return $str; |
|
|
|
} |
|
|
|
], |
|
|
|
[ |
|
|
|
'attribute' => 'Facturation', |
|
|
|
'label' => 'Détails facturation', |
|
|
|
'attribute' => 'admin_comment', |
|
|
|
'label' => 'Commentaire', |
|
|
|
'format' => 'raw', |
|
|
|
'value' => function($model) { |
|
|
|
$str = '<ul style="margin: 0px;padding-left: 15px;">'; |
|
|
|
$str .= '<li>'.Producer::$billingFrequencyArray[$model->option_billing_frequency].'</li>'; |
|
|
|
|
|
|
|
if($model->option_billing_permanent_transfer) { |
|
|
|
$str .= '<li>Virement permanent : <strong>'.Price::format($model->option_billing_permanent_transfer_amount).'</strong></li>'; |
|
|
|
'value' => function($producer) { |
|
|
|
if($producer->admin_comment) { |
|
|
|
return $producer->admin_comment; |
|
|
|
} |
|
|
|
|
|
|
|
$str .= '</ul>'; |
|
|
|
|
|
|
|
return $str; |
|
|
|
return ''; |
|
|
|
} |
|
|
|
], |
|
|
|
[ |